<template>
  <view class="coupon-box"  :class="[isUse ? 'disabled' : '']">
	  <view class=" flex" style="width: 100%;" >
	    <view class="left width-200 text-white  text-center flex align-center justify-center flex-direction"
	      style="" :class="[isUse ? 'disabled' : '']">
	      <view>
	        <text class="text-price fu-fs40"></text>
	        <text class="" style="font-size: 56rpx;font-weight: 500;">{{ discountPrice | filterPrice }}</text>
	      </view>
	      <view class="fu-fs24 margin-top-sm">{{i18n['满']}}{{ limit | filterPrice }}{{i18n['元使用']}}</view>
	    </view>
	    <view class="right   flex" style="min-width: 1px;">
	      <view class="flex-sub padding flex flex-direction justify-around" style="min-width: 1px;width: 360rpx;">
	        <view class="text-333 text-bold text-lg text-cut">{{ name }}</view>
	        <view class="text-999 text-sm text-cut-2" v-if='item && item.content' style="margin-top: 10rpx;">{{item.content}}</view>
	        <view class="text-999 text-sm text-cut" style="margin-top: 22rpx;">{{i18n['有效期至']}} {{ time }}</view>
	      </view>
	    </view>
	    <view class="action flex align-center justify-center"  style="flex-shrink: 0;background-color: #FF5C5C;width: 52rpx;color: #fff;font-size: 24rpx;text-align: center;"
	      :class="[isUse ? 'disabled' : '']" @click="handleClick"><view style="width: 24rpx;">{{ isUse ? '已使用' : '立即使用'}}</view>
	    </view>
	  </view>
  </view>
</template>

<script>
export default {
  props: {
    discountPrice: {
      type: [String, Number]
    },
    name: {
      type: String
    },
    time: {
      type: String
    },
    limit: {
      type: [String, Number]
    },
	item:{
		type:Object
	},
    isUse: {
      type: Boolean,
      default: false
    }
  },
  filters: {
    filterPrice(price) {
      return parseFloat(price);
    }
  },
  methods: {
    handleClick() {
      this.$emit('click');
    }
  }
};
</script>

<style lang="scss" scoped>
.coupon-box {
  width: 100%;
  height: 188rpx;
  background-color: #fff;
  box-shadow: -2px 4px 6px 1px rgba(0,0,0,0.06);
  border-radius: 16rpx;
  overflow: hidden;
  display: flex;
  // background-image: url($IMG_BASE_URL + 'goods/cu-bg.png');
  // background-size: 100% 100%;
  // background-repeat: no-repeat;
  &.disabled{
  		 // background-image: url($IMG_BASE_URL + 'goods/cu-bgd.png');
  		 // background-size: 100% 100%;
  		 // background-repeat: no-repeat;
  		
  }
  .left {
  		 background: linear-gradient(315deg, #FE5C5C 0%, #FF6F26 100%);
  		 color: #fff;
  		 font-size: 56rpx;
		 border-top-left-radius: 16rpx;
		 border-bottom-left-radius: 16rpx;
		 flex-shrink: 0;
		 &.disabled {
		   color: #fff!important;
			background: linear-gradient(180deg, #999999 0%, #919191 100%);
		 }
  }
  .right {
  	// padding: 22rpx 0;
  	flex: 1;
    .action {
      border-top-right-radius: 16rpx;
      border-bottom-right-radius: 16rpx;
  	font-weight: bold;
    }
  
    .action.disabled {
      // background: #999999;
  	color: #fff;
  	background: linear-gradient(180deg, #999999 0%, #919191 100%);
    }
  }
}
.action {
	&.disabled {
		color: #fff!important;
		background: linear-gradient(180deg, #999999 0%, #919191 100%) !important;
	}
}
.line-height-1{
  line-height: 1;
}
</style>
